﻿<%@ Page Title="" Language="C#" MasterPageFile="~/webmx/layout/Default.master" AutoEventWireup="true" CodeFile="List.aspx.cs" Inherits="webmx_program_banner_List" %>

<%@ Import Namespace="System.Data" %>

<asp:Content ID="Content1" ContentPlaceHolderID="mp_head" runat="Server">
    <link rel="stylesheet" href="/webmx/css/uniform.css" />
    <link rel="stylesheet" href="/webmx/css/select2.css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mp_body" runat="Server">
    <div class="container-fluid">
        <div class="row-fluid">
            <div class="span12">
                <div class="widget-box">
                    <div class="widget-title">
                        <span class="icon"><i class="icon-th"></i></span>
                        <h5>寺院动态管理</h5>
                        <div style="float: left; padding: 0 20px; height: 36px; line-height: 33px;"><a href="add.aspx" class="btn btn-success btn-mini">添加动态</a></div>
                    </div>
                    <div class="widget-content nopadding">
                        <table class="table table-bordered data-table">
                            <thead>
                                <tr>
                                    <th style="width: 160px;">图片</th>
                                    <th>标题</th>
                                    <th>链接</th>
                                    <th>排列顺序</th>
                                    <th style="width: 160px;">操作时间</th>
                                    <th style="width: 60px;">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <%if (source != null && source.Rows.Count > 0) { 
                            foreach (DataRow item in source.Rows) {%>
                                <tr class="gradeX">
                                    <td><img src="/upload/news/<%=item["Photo"] %>" style="height: 100px;" /></td>
                                    <td><%=item["Title"] %></td>
                                    <td><%=item["Attachment"] %></td>
                                    <td class="center"><%=item["SortID"] %></td>
                                    <td class="center"><%=item["AddTime"] %></td>
                                    <td class="center">
                                        <a href="set.aspx?id=<%=item["ID"] %>">编辑</a>
                                        <a class="btn_del" href="javascript:void(0);" data-id="<%=item["ID"] %>">删除</a>
                                    </td>
                                </tr>
                                <% }
                          } %>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="mp_foot" runat="Server">
    <script type="text/javascript" src="/webmx/js/jquery.uniform.js"></script>
    <script type="text/javascript" src="/webmx/js/select2.min.js"></script>
    <script type="text/javascript" src="/webmx/js/jquery.dataTables.min.js" charset="gb2312"></script>
    <script type="text/javascript" src="/webmx/js/matrix.tables.js"></script>
    <script>
        $("#sidebar ul li").removeClass("active").eq(0).addClass("active");

        $(".btn_del").click(function () {
            var row = $(this).parent().parent();
            $.get("del.ashx", "id=" + $(this).attr("data-id") + "&temp=" + new Date().getTime(), function (data) {
                if (data) {
                    var table = $("#odata").dataTable();
                    row.remove();
                    alert("操作成功");
                }
                else alert("操作失败");
            });
        });
    </script>
</asp:Content>

